#!/usr/bin/env python
# -*—coding:utf8-*-
# @author: flame
# @file: file.py
# @time: 2023/10/10 13:59

file_name = 'temp.txt'
data = 'hello,world\nhello,python\nhello,java'

with open(file_name, mode='w')as file:
    file.write(data)
    file.close()

with open(file_name, mode='r')as file:
    contents = file.readlines()
    print(contents)
    file.close()

